import request from "@/common/axios";

//整页铺码
export function fullPageSpreadCode({
  urlpath,
  writecode,
  startpageid,
  codepointmode,
  codepointtype,
  imagesize,
  imagedpi,
  pdftype,
}) {
  return request.post('/codepoint/httpallfile', {
    urlpath,
    writecode,
    startpageid,
    codepointmode,
    codepointinfo: {
      codepointtype,
      imagesize,
      imagedpi,
      pdftype,
    },
  })
}

//指定页铺码
export function specifiedPageSpreadCode({
  urlpath,
  writecode,
  pagesinfo,
  codepointmode,
  codepointtype,
  imagesize,
  imagedpi,
  pdftype,
}) {
  return request.post('/codepoint/httpskippage', {
    urlpath,
    writecode,
    pagesinfo,
    codepointmode,
    codepointinfo: {
      codepointtype,
      imagesize,
      imagedpi,
      pdftype
    }
  })
}

//获取铺码之后文件地址
export function getFileUrl(filepath) {
  return request.get('/codepoint/codeinfo', {
    params: {
      filepath
    }
  })
}